package com.xinsoft.entity.dto;

import com.xinsoft.entity.po.MesBomDetail;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author: π
 * 发货通知
 */
@Data
public class BomBodyDto {

    // 单据明细
    private String   FInterId;      //主表主键
    private String  FEntryID;     //顺序号" 子表主键 标记
    private String  FItemID;     //物料代码"
    private String  FAuxPropID;     //辅助属性"
    private String  FUnitID;     //单位"
    private String  FMaterielType;     //子项类型"
    private String  FMarshalType;     //配置属性"
    private String  FQty;     //基本单位用量"
    private String  FAuxQty;     //用量"
    private String  FBeginDay;     //生效日期"
    private String  FEndDay;     //失效日期"
    private String  FPercent;     //计划百分比(%)"
    private String  FScrap;     //损耗率(%)"
    private String  FOperSN;     //工序号"
    private String  FOperID;     //工序"
    private String  FMachinePos;     //工位"
    private String  FOffSetDay;     //提前期偏置"
    private String  FBackFlush;     //是否倒冲"
    private String  FStockID;     //发料仓库"
    private String  FSPID;     //发料仓位"
    private String  FNote;     //备注"
    private String  FPositionNo;     //位置号"
    private String  FItemSize;     //坯料尺寸"
    private String  FItemSuite;     //坯料数"
    private String  FNote1;     //备注1"
    private String  FPDMImportDate;     //PDM导入时间"
    private String  FHasChar;     //是否有特性"
    private String  FDetailID;     //唯一码"
    private String  FCostPercentage;     //拆卸成本拆分比例(%)"
    private String  FEntrySelfZ0143;     //计划金额"
    private String  FEntrySelfZ0144;     //计划金额(加入损耗率)"


//    [\r\ n {\
//        r\ n "FBrNo": "0", \
//        r\ n "FEntryID": "1", \
//        r\ n "FInterID": "2071", \
//        r\ n "FItemID": "10828", \
//        r\ n "FAuxQty": "1.0000000000", \
//        r\ n "FQty": "1.0000000000", \
//        r\ n "FScrap": "1.0000000000", \
//        r\ n "FOperSN": "0", \
//        r\ n "FOperID": "0", \
//        r\ n "FMachinePos": "", \
//        r\ n "FNote": "", \
//        r\ n "FMaterielType": "371", \
//        r\ n "FMarshalType": "385", \
//        r\ n "FPercent": "100.0000000000", \
//        r\ n "FBeginDay": "1/1/1900 12:00:00 AM", \
//        r\ n "FEndDay": "1/1/2100 12:00:00 AM", \
//        r\ n "FOffSetDay": "0.0000000000", \
//        r\ n "FBackFlush": "1058", \
//        r\ n "FStockID": "4071", \
//        r\ n "FSPID": "0", \
//        r\ n "FSupply": "0", \
//        r\ n "FUnitID": "1412", \
//        r\ n "FAuxPropID": "0", \
//        r\ n "FPDMImportDate": "", \
//        r\ n "FPositionNo": "", \
//        r\ n "FItemSize": "", \
//        r\ n "FItemSuite": "", \
//        r\ n "FNote1": "", \
//        r\ n "FNote2": "", \
//        r\ n "FNote3": "", \
//        r\ n "FHasChar": "0", \
//        r\ n "FDetailID": "8e30269c-0fd7-4e38-868e-00b5b0c8ce65", \
//        r\ n "FEntryKey": "13220", \
//        r\ n "FCostPercentage": "0.00"\
//        r\ n


    public static MesBomDetail voToPo(BomBodyDto vo) {
        if (vo == null) {
            return null;
        }
        MesBomDetail mesBomDetail = new MesBomDetail();
        mesBomDetail.setBomId(new Integer(vo.getFInterId()));
        mesBomDetail.setRowIdKis(new Integer(vo.getFEntryID()));
        mesBomDetail.setMaterialId(new Integer(vo.getFItemID()));
        mesBomDetail.setStandardCount(new BigDecimal(vo.getFQty()));
        mesBomDetail.setWasteRate(new BigDecimal(vo.getFScrap()));
        mesBomDetail.setProcessId(new Integer(vo.getFOperID()));
        mesBomDetail.setStationName(vo.getFMachinePos());
        mesBomDetail.setRemarks(vo.getFNote());
        return mesBomDetail;
    }
}
